
<!DOCTYPE html>
<!--[if IE 8]>         <html class="ie8"> <![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta name="x-ua-compatible" content="IE=Edge">
    <meta http-equiv="cleartype" content="on">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <script src="/js/jquery-1.8.3.js"></script>
    <title>uoko-passport</title>
    <link rel="stylesheet" href="/css/style/normalize.css">
    <link rel="stylesheet" href="/css/style/login_reg.css">

</head>
<body>


<div class="page-wrap on-page-2">
    <div class="form-box">

        <form action="" id="loginForm" method="" novalidate>
         <input type="hidden" name="_token" value="{{ csrf_token() }}" id="_token">

            <div class="fields">
                <div class="form-field">
                    <label><input type="text" id="pro_email" autocomplete="off" placeholder="请输入邮箱" name="pro_email" class="field-ipt" value=""></label>
                </div>
                <div class="form-field">
                    <label><input type="password" autocomplete="off" placeholder="输入密码" name="pro_pwd" class="field-ipt" id="pro_pwd"></label>
                </div>
            </div>


            <div class="btn-box">
                <input type="button" value="登  录" class="sub-btn" onclick="login()">
            </div>
            <div class="extra">
                <div class="extra-right">
                    没有账号？现在就 <a href="{{url('home/proregister')}}" class="to-regi">注册</a>
                </div>
            </div>
        </form>
    </div>
    <div class="corp-info">
        Copyright &copy; 2012-2018 uoko.com（四川优客投资管理有限公司）. All Rights Reserved 蜀ICP备13015638号-1 <i class="icon-ga"></i> <span>川公网安备 51019002001885号</span>
    </div>
</div>

</body>
</html>


<script type="text/javascript">
    function login(){
        var pro_email = $('#pro_email').val();
        var pro_pwd  = $('#pro_pwd').val();
        var _token    = $('#_token').val();

        var data = new FormData();

        data.append('pro_email',pro_email);
        data.append('pro_pwd',pro_pwd);
        data.append('_token',_token);

        $.ajax({
            type:"POST",
            url:"{{url('/home/prologin_do')}}",
            data:data,
            cache: false,
            processData: false,
            contentType: false,
            success : function(msg){
                if(msg == 1){
                    //alert('登陆成功')
                    window.location.href="{{ url('/home/index') }}";
                }else{
                    alert('账号或密码错误')
                    window.location.href="{{ url('/home/prologin') }}";
                }
            }
        });
    }
</script>
